package com.qingcheng.service.impl;


import com.alibaba.dubbo.config.annotation.Service;
import com.qingcheng.service.system.Login2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;

@Service
public class Login2ServiceImpl implements Login2Service{

    @Autowired
    private RedisTemplate redisTemplate;

    //存
    public void save(Integer score){

        redisTemplate.boundValueOps("score").set(score);

    }

    //查
    public Integer findScore(){

        Integer str = (Integer) redisTemplate.boundValueOps("score").get();

        return str;
    }

    //删
    public void delScore() {

        redisTemplate.delete("score");

    }
}
